package com.woniu.service.sportsHealth.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniu.mapper.sportsHealth.BloodSugarMapper;
import com.woniu.model.sportsHealth.entity.BloodSugar;
import com.woniu.model.sportsHealth.model.dto.BloodSugarDto;
import com.woniu.model.sportsHealth.model.vo.BloodSugarVo;
import com.woniu.service.sportsHealth.IBloodSugarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 血糖表 服务实现类
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@Service
public class BloodSugarServiceImpl extends ServiceImpl<BloodSugarMapper, BloodSugar> implements IBloodSugarService {

    @Autowired
    BloodSugarMapper bloodSugarMapper;
    @Override
    public PageInfo<BloodSugarDto> findAll(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<BloodSugarDto> sugarDtoList = bloodSugarMapper.findAll(param);
        PageInfo<BloodSugarDto> pageInfo = new PageInfo<>(sugarDtoList);
        return pageInfo;
    }

    @Override
    public List<BloodSugarVo> findAllExport() {
        List<BloodSugarVo> allExport = bloodSugarMapper.findAllExport();
        return allExport;
    }
}
